package com.tnr.scgcxx.base;

public class Result {

    public static Result success(){
        return  new Result(true,null,null);
    }
    public static Result success(String message){
        return  new Result(true,message,null);
    }
    public static Result success(String message, Object data){
        return  new Result(true,message,data);
    }

    public static Result fail(){
        return  new Result(false,null,null);
    }
    public static Result fail(String message){
        return  new Result(false,message,null);
    }
    public static Result fail(String message, Object data){
        return  new Result(false,message,data);
    }

    private boolean success;
    private String message;
    private Object data;

    public Result(boolean success, String message, Object data) {
        this.success = success;
        this.message = message;
        this.data = data;
    }

    public boolean isSuccess() {
        return success;
    }

    public String getMessage() {
        return message;
    }

    public Object getData() {
        return data;
    }
}
